home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
u_man
/
cat1
/
test.z
/
test
Wrap
Text File
|
1998-10-20
|
5KB
|
133 lines
TTTTEEEESSSSTTTT((((1111)))) TTTTEEEESSSSTTTT((((1111))))
NNNNAAAAMMMMEEEE
test - condition evaluation command
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
tttteeeesssstttt expr
[[[[ expr ]]]]
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_t_e_s_t evaluates the expression _e_x_p_r and, if its value is true, sets a zero
(true) exit status; otherwise, a non-zero (false) exit status is set;
_t_e_s_t also sets a non-zero exit status if there are no arguments. When
permissions are tested, the effective user ID of the process is used.
All operators, flags, and brackets (brackets used as shown in the second
SYNOPSIS line) must be separate arguments to the _t_e_s_t command; normally
these items are separated by spaces.
The following primitives are used to construct _e_x_p_r:
----rrrr _f_i_l_e true if _f_i_l_e exists and is readable.
----llll _f_i_l_e true if _f_i_l_e exists and is a symbolic link.
----wwww _f_i_l_e true if _f_i_l_e exists and is writable.
----xxxx _f_i_l_e true if _f_i_l_e exists and is executable.
----ffff _f_i_l_e true if _f_i_l_e exists and is a regular file.
----dddd _f_i_l_e true if _f_i_l_e exists and is a directory.
----hhhh _f_i_l_e true if _f_i_l_e exists and is a symbolic link.
----cccc _f_i_l_e true if _f_i_l_e exists and is a character special file.
----bbbb _f_i_l_e true if _f_i_l_e exists and is a block special file.
----pppp _f_i_l_e true if _f_i_l_e exists and is a named pipe (fifo).
----uuuu _f_i_l_e true if _f_i_l_e exists and its set-user-ID bit is set.
----gggg _f_i_l_e true if _f_i_l_e exists and its set-group-ID bit is set.
----kkkk _f_i_l_e true if _f_i_l_e exists and its sticky bit is set.
----ssss _f_i_l_e true if _f_i_l_e exists and has a size greater than zero.
----tttt [ _f_i_l_d_e_s ]
true if the open file whose file descriptor number is _f_i_l_d_e_s
(1 by default) is associated with a terminal device.
PPPPaaaaggggeeee 1111
TTTTEEEESSSSTTTT((((1111)))) TTTTEEEESSSSTTTT((((1111))))
----zzzz _s_1 true if the length of string _s_1 is zero.
----nnnn _s_1 true if the length of the string _s_1 is non-zero.
_s_1 ==== _s_2 true if strings _s_1 and _s_2 are identical.
_s_1 !!!!==== _s_2 true if strings _s_1 and _s_2 are _n_o_t identical.
_s_1 true if _s_1 is _n_o_t the null string.
_n_1 ----eeeeqqqq _n_2 true if the integers _n_1 and _n_2 are algebraically equal. Any
of the comparisons ----nnnneeee, ----ggggtttt, ----ggggeeee, ----lllltttt, and ----lllleeee may be used in
place of ----eeeeqqqq.
----LLLL _f_i_l_e true if _f_i_l_e exists and is a symbolic link.
These primaries may be combined with the following operators:
!!!! unary negation operator.
----aaaa binary _a_n_d operator.
----oooo binary _o_r operator (----aaaa has higher precedence than ----oooo).
(((( expr )))) parentheses for grouping. Notice also that parentheses are
meaningful to the shell and, therefore, must be quoted.
SSSSEEEEEEEE AAAALLLLSSSSOOOO
find(1), sh(1).
WWWWAAAARRRRNNNNIIIINNNNGGGG
If you test a file you own (the -_r, -_w, or -_x tests), but the permission
tested does not have the _o_w_n_e_r bit set, a non-zero (false) exit status
will be returned even though the file may have the _g_r_o_u_p or _o_t_h_e_r bit set
for that permission. The correct exit status will be set if you are
super-user.
The ==== and !!!!==== operators have a higher precedence than the ----rrrr through ----nnnn
operators, and ==== and !!!!==== always expect arguments; therefore, ==== and !!!!====
cannot be used with the ----rrrr through ----nnnn operators.
If more than one argument follows the ----rrrr through ----nnnn operators, only the
first argument is examined; the others are ignored, unless a ----aaaa or a ----oooo
is the second argument.
PPPPaaaaggggeeee 2222